package com.rr.learningdemo.service.impl;

import com.rr.learningdemo.service.DivideService;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;

/**
 * @author zhuangcanrun
 * @Date 2021/05/24/15:06
 * @description
 **/

@Service
public class DivideServiceImpl implements DivideService {
    @Retryable(include = Exception.class, maxAttempts = 4, backoff = @Backoff(delay = 1000L, multiplier = 1))
    public int divide(Integer num) {
        System.out.println("100/" + num);
        return 100 / num;
    }
}
